[#ftl]
[#assign packageBase]${project.packageName!'com.smzd.proforge.generated'}[/#assign]

[#macro simpleClassName clazz][#if clazz.className?has_content]${clazz.className}[#else]C${clazz.id}[/#if][/#macro]
[#macro fullClassName clazz]${packageBase}.domain.[@simpleClassName clazz=clazz/][/#macro]

[#macro attributeName attr][#if attr.attributeName?has_content]${attr.attributeName}[#else]a${attr.id}[/#if][/#macro]

[#macro getter attr][#if attr.type==5&&!attr.nullable]is[#else]get[/#if][#if attr.attributeName?has_content]${attr.attributeName?cap_first}[#else]A${attr.id}[/#if][/#macro]
[#macro setter attr]set[#if attr.attributeName?has_content]${attr.attributeName?cap_first}[#else]A${attr.id}[/#if][/#macro]

[#macro ownerType level][#switch level][#case 1]Meeting[#break][#case 2]Group[#break][#case 3]User[#break][/#switch][/#macro]

[#macro javatype attr][#switch attr.type][#case 0]String[#break][#case 1]Integer[#break][#case 2]Long[#break][#case 3]Float[#break][#case 4]Double[#break][#case 5]Boolean[#break][#case 6][#case 7][#case 8]Date[#break][#case 9][@simpleClassName clazz=attr.refClass/][#break][#case 10]Meeting[#break][#case 11]Group[#break][#case 12]User[#break][#default]UNKOWN${attr.type}[/#switch][/#macro]

[#macro dbFieldTypeMySQL attr][#switch attr.type][#case 0]varchar(${attr.size})[#break][#case 1]int[#break][#case 2]bigint[#break][#case 3]float[#break][#case 4]double[#break][#case 5]boolean[#break][#case 6][#case 7][#case 8]datetime[#break][#case 9][#case 10][#case 11][#case 12]int(10) unsigned[#break][#default]UNKOWN${attr.type}[/#switch][/#macro]
[#macro dbFieldTypeMsSQL attr][#switch attr.type][#case 0]varchar(${attr.size})[#break][#case 1]int[#break][#case 2]bigint[#break][#case 3]float[#break][#case 4]real[#break][#case 5]tinyint[#break][#case 6][#case 7][#case 8]datetime[#break][#case 9][#case 10][#case 11][#case 12]BigInt[#break][#default]UNKOWN${attr.type}[/#switch][/#macro]

[#macro domainExtends clazz]Base[#if clazz.scopeClass??]Scope[/#if][#if clazz.ownerLevel>0]Owned[#else][#if !(clazz.scopeClass??)]IntId[/#if][/#if]Entity[/#macro]
[#macro domainParaTypes clazz][#if clazz.scopeClass??]<[@simpleClassName clazz=clazz.scopeClass/][#if clazz.ownerLevel>0], [@ownerClassName level=clazz.ownerLevel/][/#if]>[#else][#if clazz.ownerLevel>0]<[@ownerClassName level=clazz.ownerLevel/]>[/#if][/#if][/#macro]
[#macro pagingExtends clazz][#if clazz.scopeClass??]S[/#if][#if clazz.ownerLevel>0]O[/#if]RPage[/#macro]

[#macro actionExtends clazz]Abstract[#switch clazz.ownerLevel][#case 0][#if clazz.scopeClass??]Scoped[/#if][#break][#case 1]Meeting[#if clazz.scopeClass??]Scoped[#else]Owned[/#if][#break][#case 2]Group[#if clazz.scopeClass??]Scoped[#else]Owned[/#if][#break][#case 3]User[#if clazz.scopeClass??]Scoped[#else]Owned[/#if][#break][#default]AbstractLevel${clazz.ownerLevel}[#if clazz.scopeClass??]Scoped[#else]Owned[/#if][/#switch]Controller[/#macro]

[#assign dbprefix][#if project.dbprefix?has_content]${project.dbprefix?lower_case}_[/#if][/#assign]

[#macro moduleName clazz][#if clazz.entryName?has_content]${clazz.entryName?lower_case}[#else][#assign className][@simpleClassName clazz=clazz/][/#assign]${className?lower_case}[/#if][/#macro]
[#macro moduleNames clazz][#if clazz.entryNames?has_content]${clazz.entryNames?lower_case}[#else][@moduleName clazz=clazz/]s[/#if][/#macro]

[#macro ownerTableAlias level][#switch level][#case 1]meetings[#break][#case 2]groups[#break][#case 3]users[#break][#default]UNKOWN_SYS_TABLE_${level}[/#switch][/#macro]
[#macro ownerTableName level][#switch level][#case 1]sys_meetings[#break][#case 2]sys_groups[#break][#case 3]sys_users[#break][#default]TABLE_${level}[/#switch][/#macro]

[#macro tableAlias clazz][#if clazz.tableAlias?has_content]${clazz.tableAlias?lower_case}[#else][@tableName clazz=clazz/][/#if][/#macro]
[#macro tableName clazz][#if clazz.tableName?has_content]${clazz.tableName?lower_case}[#else][@moduleNames clazz=clazz/][/#if][/#macro]
[#macro fullTableName clazz]${dbprefix}[@tableName clazz=clazz/][/#macro]
[#macro mtmTableAlias mtm][@tableAlias clazz=mtm.master/][@tableName clazz=mtm.slave/][/#macro]
[#macro mtmTableName mtm]${dbprefix}[@mtmTableAlias mtm=mtm/][/#macro]
[#macro mtmPKFK clazz][#if clazz.tableAlias?has_content]${clazz.tableAlias?lower_case}[#else][@moduleName clazz=clazz/][/#if]id[/#macro]

[#macro fieldName attr][@attributeName attr=attr/][#if attr.type>8]id[/#if][/#macro]
[#macro fieldValue attr][@attributeName attr=attr/][#if attr.type>8].id[/#if][/#macro]


[#macro attrClassName attr][#if attr.type==9][@fullClassName clazz=attr.refClass/][#else][#if attr.type>9]com.smzd.framework.system.domain.[#switch attr.type][#case 10]Meeting[#break][#case 11]Group[#break][#case 12]User[#break][#default]UNKOWN${attr.type}[/#switch][#else]WRONGCALL${attr.type}[/#if][/#if][/#macro]

[#macro ownerClassName level][#switch level][#case 1]Meeting[#break][#case 2]Group[#break][#case 3]User[#break][/#switch][/#macro]
[#macro importOwnerClass level][#if level>0]import com.smzd.framework.system.domain.[@ownerClassName level=level/];[/#if][/#macro]